import sun.util.resources.LocaleData;

import java.io.IOException;
import java.io.PrintStream;
import java.time.LocalDate;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入文件名：");
        String filename = scanner.nextLine();
        try(PrintStream printer = new PrintStream(filename)){
            printer.println("Hello");
            printer.println("当前时间："+ LocalDate.now());
        }catch (IOException e){
            System.out.println(e.getMessage());
        }
    }
}